﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;


namespace XFFSM
{
    public enum Style { 
        Normal=0,
        Blue,
        Mint,
        Green,
        Yellow,
        Orange,
        Red,
        NormalOn,
        BlueOn,
        MintOn,
        GreenOn,
        YellowOn,
        OrangeOn,
        RedOn,
    }

    public class StateStyles
    {
        private Dictionary<int, GUIStyle> styleDictionary = null;
        public StateStyles() {

            styleDictionary = new Dictionary<int, GUIStyle>();
            for (int i = 0; i <= 6; i++)
            {
                styleDictionary.Add(i, new GUIStyle(string.Format("flow node {0}", i)));
                styleDictionary.Add(i + 7, new GUIStyle(string.Format("flow node {0} on", i)));
            }

        }

        public GUIStyle Get(Style style) {
            return styleDictionary[(int)style];
        }

        public void ApplyZoomFactor(float zoomFactor) {
            foreach (var item in styleDictionary.Values)
            {
                item.fontSize = (int)Mathf.Lerp(5, 30, zoomFactor);
                item.contentOffset = new Vector2(0,Mathf.Lerp(-30,-20,zoomFactor));
            }
        }

    }

}

